package com.qianniu.napi.admin.web;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by chenxuebin on 2017/2/28.
 */
@RestController
public class IndexController {

    private static Logger logger = LoggerFactory.getLogger(IndexController.class);

    @RequestMapping("/")
    public String index(Model model) {

        return "hello qianniu";
    }

    @RequestMapping("/index")
    public String list(Model model) {
        System.out.println("this is index");
        return "index";
    }

    @RequestMapping("/team")
    public String team(Model model) {
        System.out.println("this is team");
        Map<String, String> obj = new HashMap<String, String>();
        obj.put("name", "yii");
        model.addAttribute("son", obj);
        return "team";
    }

}
